﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once

// std headers
#include <string>
#include <memory>

// qt headers

// gcmp headers
#include "OwnerPtr.h"

// custom headers
#include "GcsService.h"


namespace gcmp
{
    class IFamilyFile;
    class IParameter;
}

namespace gmepgcs
{
    struct ISpecification;
}

namespace gmepgcs
{
    class GCS_SERVICE_EXPORTS FamilyFileService
    {
    public:
        explicit FamilyFileService(const std::wstring &familyFileFullPath);

        FamilyFileService(const FamilyFileService &) = default;
        FamilyFileService &operator=(const FamilyFileService &) = default;

        virtual ~FamilyFileService();

    public:
        static std::shared_ptr<FamilyFileService> Create(const std::wstring &familyFileFullPath);

    public:
        bool UpdateDrivenParameters(std::shared_ptr<ISpecification> specification, bool &hasUpdated);
        bool TryUpdateGeometry(std::shared_ptr<ISpecification> specification);

    private:
        gcmp::OwnerPtr<gcmp::IFamilyFile> m_opFamilyFile;
    };
}